Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: OpenDoc Class Reference /
Part 1 - Classes and Methods / ODDocument


CollapseDrafts

Document Shell

The CollapseDrafts method removes the specified range of empty drafts from this document.

ODDocument CollapseDrafts (in ODDraft from, 
                           in ODDraft to);
from
A reference to the first (most recent) draft in the range.
to
A reference to the last (oldest) draft in the range.
return value
A reference to this document with the specified drafts removed.
DISCUSSION
If the to parameter is kODNULL, it is set to the draft immediately previous to (below) the from draft. When successful, this method removes all the drafts between the from draft (inclusive) and the to draft (exclusive), and returns a reference to the amended document object. This method maintains the appropriate draft topology for this document. After successful execution, the from draft is no longer a valid draft object.

For this method to be successful, the following conditions must all be met:

Before calling this method, the document shell or container application can call the SaveToAPrevDraft method to consolidate the changes in a range of drafts.

EXCEPTIONS
kODErrCannotCollapseDrafts
The from draft is not a more recent draft than the to draft.
kODErrNonEmptyDraft
There are non-empty draft(s) between the from draft (inclusive) and the to draft (exclusive).
kODErrOutstandingDraft
There are outstanding drafts between the from draft (exclusive) and the to draft (exclusive) or the from draft has a reference count greater than 1.
SEE ALSO
The ODDocument::SaveToAPrevDraft method (page 144).


Previous Book Contents Book Index Next

© Apple Computer, Inc.
17 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help